<?php

$sql = "select * from ".MICROSHOPCOUPONSCONFIG." order by create_time desc";
//=======分页=============
include_once("../includes/page_utf_class.php");
$page = new Page;
$page->listRows=20;
$db->query($sql);
$totalRows = $db->num_rows();
if (!$page->__get('totalRows')){
    $db->query($sql);
    $de['count'] = $page->totalRows = $db->num_rows();
}
$sql .= "  limit ".$page->firstRow.",".$page->listRows;
$de['count']=$de['count']?$de['count']:($_GET['totalRows']?$_GET['totalRows']:'0');
$de['page'] = $page->prompt();
$de['perPageRows'] = $page->listRows;
//=====================
$db->query($sql);
$de['list']=$db->getRows();

$tpl->assign('de',$de);
$tpl->display('coupons_package_config_list.htm');